#pragma once

#define PAGE_NOACCESS			0x01     // winnt
#define PAGE_READONLY			0x02     // winnt
#define PAGE_READWRITE			0x04     // winnt
#define PAGE_WRITECOPY			0x08     // winnt
#define PAGE_EXECUTE			0x10     // winnt
#define PAGE_EXECUTE_READ		0x20     // winnt
#define PAGE_EXECUTE_READWRITE	0x40     // winnt
#define PAGE_EXECUTE_WRITECOPY	0x80     // winnt
#define PAGE_GUARD				0x100     // winnt
#define PAGE_NOCACHE			0x200     // winnt
#define OBJ_INHERIT             0x00000002L
#define OBJ_PERMANENT           0x00000010L
#define OBJ_EXCLUSIVE           0x00000020L
#define OBJ_CASE_INSENSITIVE    0x00000040L
#define OBJ_OPENIF              0x00000080L
#define OBJ_OPENLINK            0x00000100L
#define OBJ_VALID_ATTRIBUTES    0x000001F2L


HANDLE OpenPhysicalMemory();

VOID UnmapPhysicalMemory(  DWORD Address );

BOOLEAN MapPhysicalMemory( HANDLE PhysicalMemory,
						  PDWORD Address, 
						  PDWORD Length,
						  PDWORD VirtualAddress );

DWORD mread(HANDLE hMem, LONGLONG offset);

BOOL mreadbuf(HANDLE hMem, LONGLONG offset, BYTE* pBuf, DWORD dwSize);

DWORD TransV2P(HANDLE hMemory, DWORD dwVirAddr);

BOOL read_unicode_string(HANDLE	physmem, PVOID pUnicodeString, WCHAR* pwStr);

BOOL read_unicode_string_on_memory(HANDLE phys, LONGLONG offset, WCHAR* pwStr);
